<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%request.setCharacterEncoding("utf-8");%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<title>搜索留言</title>
</head>

<body>
<c:if test="${requestScope.Search!=null}">
	<div id="head">
		<h1>JSP+Servlet+Bean 留言本</h1>
	</div>
	<div id="nav">
		您的位置：<a href="index.jsp">首页</a> &gt;&gt; 搜索留言
		<font color="#ff0000">${requestScope.q}</font>
	</div>
	<div id="main">
		<div id="title">
			<ul>
				<li class="cid">编号</li>
				<li class="title">标题</li>
				<li class="click">点击</li>
				<li class="user">用户</li>
				<li class="act">操作</li>
			</ul>
		</div>
	<c:forEach var="slist" items="${requestScope.Search}">
		<div class="list">
			<ul>
				<li class="cid">${slist.id}</li>
				<li class="title"><a href="view?id=${slist.id}" target="_blank" title="post time:${slist.posttime}">${slist.title}</a></li>
				<li class="click">${slist.hitsnum}</li>
				<li class="user">${slist.user}</li>
				<c:if test="${sessionScope.admin==null}"><li class="act">删除</li></c:if>
					<c:if test="${sessionScope.admin!=null}"><li class="act"><a href="Do?id=${slist.id}">删除</a></li></c:if>
			</ul>
		</div>
	</c:forEach>
	<div id="page">		
		总共<font color="#ff0000">${requestScope.allsize}</font>条 &nbsp;
		每页显示<font color="#ff0000">${requestScope.pagesize}</font>条 &nbsp;	
		共<font color="#ff0000">${requestScope.allpage}</font>页			
		当前第<font color="#ff0000">${requestScope.page}</font>页 &nbsp;
		
	<c:if test="${requestScope.page>1}">
		<a href='Search?q=${requestScope.q}'>首页</a>
		<a href='Search?q=${requestScope.q}&page=${requestScope.page-1}'>上页</a>
	</c:if>	
	<c:if test="${requestScope.page<requestScope.allpage}">
		<a href='Search?q=${requestScope.q}&page=${requestScope.page+1}'>下页</a>
		<a href='Search?q=${requestScope.q}&page=${requestScope.allpage}'>尾页</a>
	</c:if>	
	</div>
	
	</div>
	<div id="foot">
		power by diplodocus
	</div>
</c:if>
</body>
</html>